package jetx;

public class SimpleBean {
    public String name;
    private ComBean cb;
    public int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ComBean getCb() {
        return cb;
    }

    public void setCb(ComBean cb) {
        this.cb = cb;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static void main(String[] args) {
        System.out.println("name".hashCode());
        System.out.println("age".hashCode());
        System.out.println("cb".hashCode());
    }

    public boolean push(String fieldName, Object value) {
        switch (fieldName.hashCode()) {
            case 3373707:
                if ("name".equals(fieldName)) {
                    this.name = (String) value;
                    return true;
                }
                break;
            case 96511:
                if ("age".equals(fieldName)) {
                    this.age = (int) value;
                    return true;
                }
                break;
            case 3167:
                if ("cb".equals(fieldName)) {
                    this.cb = (ComBean) value;
                    return true;
                }
                break;
            default:
                return false;
        }
        return false;
    }

    public Object pull(String fieldName) {
        switch (fieldName.hashCode()) {
            case 3373707:
                if ("name".equals(fieldName)) {
                    return this.name;
                }
                break;
            case 96511:
                if ("age".equals(fieldName)) {
                    return this.age;
                }
                break;
            case 3167:
                if ("cb".equals(fieldName)) {
                    return this.cb;
                }
                break;
            default:
                return null;
        }
        return null;
    }
}